package com.jijuxie.house.task;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.jijuxie.house.service.IHouseService;

import lombok.extern.slf4j.Slf4j;

@Component
@Slf4j
public class HouseCleanTask {

    @Autowired
    private IHouseService houseService;

    /**
     * 每天凌晨3点执行清理
     */
    @Scheduled(cron = "0 0 3 * * ?")
    public void cleanDeletedHouses() {
        log.info("开始执行房源清理任务");
        houseService.cleanDeletedHouses();
    }
}
